const global = getApp().globalData;
const util = global.util;
Component({
  data: {
    timeText: ''
  },
  properties: {
    rank: {
      type: null
    },
    icon: {
      type: String
    },
    name: {
      type: String
    },
    time: {
      type: null,
      observer: "_timeObserver"
    }
  },
  attached() {
    this.timeFormat( this.data.time );
  },
  methods: {
    timeFormat( msec ) {
      let time = util.msecFormat( msec );
      time = time.minute + ':' + time.second + '.' + time.ms;
      this.setData({
        timeText: time
      })
    },
    _timeObserver( val ) {
      this.timeFormat( val );
    }
  }
})